package com.qf.business.system.application;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * description: 启动类
 * author: Ken
 * 公众号：Java架构栈
 */
@SpringBootApplication
public class SystemApplication {

    public static void main(String[] args) {
        SpringApplication.run(SystemApplication.class, args);
    }

    /**
     * 配置Cors过滤器 解决跨域问题
     * @return
     */
//    @Bean
//    public CorsFilter getCorsFilter(){
//        CorsConfiguration corsConfiguration = new CorsConfiguration();
//        corsConfiguration.addAllowedMethod("*");//所有请求类型跨域 GET POST
//        corsConfiguration.addAllowedHeader("*");//允许所有请求头部类型跨域
//        corsConfiguration.addAllowedOrigin("*");//允许所有主机地址跨域
//        corsConfiguration.setAllowCredentials(true);//允许cookie跨域
//
//        UrlBasedCorsConfigurationSource corsConfigurationSource = new UrlBasedCorsConfigurationSource();
//        corsConfigurationSource.registerCorsConfiguration("/**", corsConfiguration);
//        return new CorsFilter(corsConfigurationSource);
//    }
}
